import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
const routes: Array<RouteRecordRaw> = [
    {
        path: '/login',
        name: 'Login',
        meta: {
            title: '登录',
            keepAlive: true,
            requireAuth: false
        },
        component: () => import('../pages/login.vue')
    },
    {
        path: '/',
        name: 'layout',
        meta: {
            title: '首页',
            keepAlive: true,
            requireAuth: true
        },
        redirect: '/pinia',
        component: () => import('../layout/index.vue'),
        children: [
            {
                path: '/pinia',
                name: 'pinia',
                meta: {
                    title: 'pinia',
                    keepAlive: true,
                    requireAuth: true
                },
                component: () => import('../pages/pinia.vue')
            }
        ]
    },

]

const router = createRouter({
    history: createWebHistory(),
    routes
})
export default router
